Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
why my "onChange" function is not performing?

export function UpdateData(props){


    return(
        <div>
            <div className='updateForm'>
                <form>
                    <div className="form-group">
                        <label>Your ID:</label>
                        <input name="id" type="text" defaultValue={props.usersData._id} autoComplete="off" className="form-control" readOnly></input>
                        <label>Enter your name:</label>
                        <input name="name" type="text" defaultValue={props.usersData.name} autoComplete="off" placeholder="Enter your name here....." className="form-control"
                        onChange={(e)=>console.log(e.target.value)}></input>
                        <label>Enter your age:</label>
                        <input name="age" type="text" defaultValue={props.usersData.age} autoComplete="off" placeholder="Enter your age here....." className="form-control"
                        onChange={(e)=>console.log(e.target.value)}></input>
                        <label>Enter your city:</label>
                        <input name="city" type="text" defaultValue={props.usersData.city} autoComplete="off" placeholder="Enter your city here....." className="form-control"
                        onChange={(e)=>console.log(e.target.value)}></input>
                        <br/>
                        <button className="btn" id="myButton2">Save Update</button>
                    </div>
                </form>
            </div>
        </div>
    )
}

I want to console out the changes of the input field, but "onChange" function is not performing accordingly. I have used document.getElementById("updateCont").innerHTML=ReactDOMServer.renderToString(); to send the data.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Have you tried to declare a handleChange function and then set it to the onChange attribute?

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda